bitkeeper revision 1.1054 (40ed8e097hqWQ3yDtTM5H6XnNbggVQ)
authorgm281@boulderdash.cl.cam.ac.uk <gm281@boulderdash.cl.cam.ac.uk>
Thu, 8 Jul 2004 18:10:17 +0000 (18:10 +0000)
committergm281@boulderdash.cl.cam.ac.uk <gm281@boulderdash.cl.cam.ac.uk>
Thu, 8 Jul 2004 18:10:17 +0000 (18:10 +0000)
Minor changes to make xen compile when debugging is switched on.

xen/common/debug.c
xen/common/domain.c
xen/common/sched_fair_bvt.c
xen/common/schedule.c

index 1cf4c57d375f01a7ceb013a3a2930a34e8d6fa8a..b17748a864b70f21fe52f12098e84573d558027c 100644 (file)
@@ -12,6 +12,7 @@
 #include <xen/event.h>
 #include <asm/page.h>
 #include <asm/pdb.h>
+#include <asm/shadow.h>
 
 #undef DEBUG_TRACE
 #ifdef DEBUG_TRACE
index 76d0f61df11e4ec04ed9827f75ceff1096f09d42..3df97a7e25da558baf9afeeb837261346ddc362d 100644 (file)
@@ -11,6 +11,8 @@
 #include <xen/shadow.h>
 #include <xen/elf.h>
 #include <hypervisor-ifs/dom0_ops.h>
+#include <asm/hardirq.h>
+#include <asm/domain_page.h>
 
 /* Both these structures are protected by the tasklist_lock. */
 rwlock_t tasklist_lock __cacheline_aligned = RW_LOCK_UNLOCKED;
index f20b754ab4bbb6624b600617f8120c9329600aa1..a7aa0335cf624ead2f04eb132c021939931b2ec6 100644 (file)
@@ -1,19 +1,20 @@
 /* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
  ****************************************************************************
- * (C) 2002-2003 - Rolf Neugebauer - Intel Research Cambridge
- * (C) 2002-2003 University of Cambridge
- * (C) 2004      - Mark Williamson - Intel Research Cambridge
+ * (C) 2004      Grzegorz Milos - University of Cambridge
+ * Based on the implementation of the BVT scheduler by Rolf Neugebauer
+ * and Mark Williamson (look in sched_bvt.c)
  ****************************************************************************
  *
- *        File: common/schedule.c
- *      Author: Rolf Neugebauer & Keir Fraser
- *              Updated for generic API by Mark Williamson
+ *        File: common/sched_fair_bvt.c
+ *      Author: Grzegorz Milos
  *
  * Description: CPU scheduling
- *              implements A Borrowed Virtual Time scheduler.
- *              (see Duda & Cheriton SOSP'99)
+ *              implements Fair Borrowed Virtual Time Scheduler.
+ *              FBVT is modification of BVT (see Duda & Cheriton SOSP'99)
+ *              which tries to allocate fair shares of processor even 
+ *              when there is mix between CPU and I/O bound domains.
+ *              TODO - more information about the scheduler in TODO
  */
-
 #include <xen/config.h>
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/perfc.h>
 #include <xen/sched-if.h>
 #include <xen/slab.h>
+#include <xen/trace.h>
+
+/* For tracing - TODO - put all the defines in some common hearder file */
+#define TRC_SCHED_FBVT_DO_SCHED             0x00020000
 
 
 /* all per-domain BVT-specific scheduling info is stored here */
@@ -171,7 +176,7 @@ void fbvt_wake_up(struct domain *p)
                 */
        
                io_warp = (int)(0.5 * inf->time_slept);
-               if(io_warp > 10000) io_warp = 10000;
+               if(io_warp > 1000) io_warp = 1000;
 
                ASSERT(inf->time_slept + CPU_SVT(p->processor) > inf->avt + io_warp);
                inf->time_slept += CPU_SVT(p->processor) - inf->avt - io_warp;
@@ -429,13 +434,16 @@ static task_slice_t fbvt_do_schedule(s_time_t now)
    
     r_time = ((next_prime_inf->evt + next_inf->vtb - next_inf->evt)/next_inf->mcu_advance)
         + ctx_allow;
-
+        
     ASSERT(r_time >= ctx_allow);
 
  sched_done:
+    TRACE_2D(TRC_SCHED_FBVT_DO_SCHED, next->domain, r_time);
     next->min_slice = ctx_allow;
     ret.task = next;
     ret.time = r_time;
     return ret;
 }
 
index ec4971f4d093989875f5dc6330a75f73f8a9abdf..f31fab94fc427ebcd368d3b82ec8d572abadd5b7 100644 (file)
@@ -381,7 +381,6 @@ void __enter_scheduler(void)
     rem_ac_timer(&schedule_data[cpu].s_timer);
     
     ASSERT(!in_irq());
-if(!__task_on_runqueue(prev)) printk("Domain %d not on runqueue\n",prev->domain);
     ASSERT(__task_on_runqueue(prev));
 
     if ( test_bit(DF_BLOCKED, &prev->flags) )